import _ from 'lodash';
import Application from 'core/Application';
import pageRoutes from 'core/pageRoutes';


export default class {
    constructor() {

        this.langs = ['en', 'cn', 'hk'];
        this.mainLanguage = 'cn';
        this.tpl = ({ html }) => ``;
        this.name = '';
    }

    render({ lang ='cn', name='frame' }) {
        let app = new Application();
        global.$$ = app;
        return app.prepare({ routes: pageRoutes, lang }).renderString(`/${lang}/${name}`).then(html => {
            //console.log(res);
            return this.tpl({ html });
        });

    }
};